﻿<%
PingContent=pingurls

Function SendPing
Dim Url,Urls
Urls=Split(Replace(PingContent,vbCr,""),"|") 
For Each Url In Urls
If Trim(Url)<>"" Then
Call SendPing_Single(url)
End If
Next
End Function
 
Function SendPing_Single(url)
On Error Resume Next
Dim s,sUrl 
s = "<?xml version=""1.0"" encoding=""UTF-8""?>"
s = s&"<methodCall><methodName>weblogUpdates.ping</methodName>"
s = s&"<params><param><value>"&BlogName&"-"&BlogTName&"</value></param>"
s = s&"<param><value>"&BlogURL&"</value></param></params>"
s = s&"</methodCall>"
Response.Write "<p>发送Ping到:" & Url & "</p>"
Response.Flush
Dim objPing
Set objPing = Server.CreateObject("MSXML2.ServerXMLHTTP")
objPing.SetTimeOuts 10000, 10000, 10000, 10000
'第一个数值：解析DNS名字的超时时间10秒
'第二个数值：建立Winsock连接的超时时间10秒
'第三个数值：发送数据的超时时间10秒
'第四个数值：接收response的超时时间10秒
objPing.open "POST",url,False
objPing.setRequestHeader "Content-Type", "text/xml"
objPing.send s
Set objPing = Nothing
Err.Clear
End Function%>